
#include "bzEvents.h"

void CTFCapture::process( bz_EventData *eventData )
{
	bz_CTFCaptureEventData *data = (bz_CTFCaptureEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_ctf_capture_event_data_class(), 0, 0, data);
	
	emit_ruby_event("ctf_capture", rdata);
}

void PlayerDie::process( bz_EventData *eventData )
{
	bz_PlayerDieEventData *data = (bz_PlayerDieEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_player_die_event_data_class(), 0, 0, data);

	emit_ruby_event("player_die", rdata);
}

void PlayerSpawn::process( bz_EventData *eventData )
{
	bz_PlayerSpawnEventData *data = (bz_PlayerSpawnEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_player_spawn_event_data_class(), 0, 0, data);

	emit_ruby_event("player_spawn", rdata);
}

void Chat::process( bz_EventData *eventData )
{
	bz_ChatEventData *data = (bz_ChatEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_chat_event_data_class(), 0, 0, data);

	emit_ruby_event("chat", rdata);
}

void PlayerJoinPart::process( bz_EventData *eventData )
{
	bz_PlayerJoinPartEventData *data = (bz_PlayerJoinPartEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_player_join_part_event_data_class(), 0, 0, data);

	if ( eventData->eventType == bz_ePlayerJoinEvent)
		emit_ruby_event("player_join", rdata);

	if ( eventData->eventType == bz_ePlayerPartEvent)
		emit_ruby_event("player_part", rdata);
}

void UnknownSlashCommand::process( bz_EventData *eventData )
{
	bz_UnknownSlashCommandEventData *data = (bz_UnknownSlashCommandEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_unknown_slash_command_event_data_class(), 0, 0, data);

	emit_ruby_event("unknown_slash_command", rdata);
}

void GetPlayerSpawnPos::process( bz_EventData *eventData )
{
	bz_GetPlayerSpawnPosEventData *data = (bz_GetPlayerSpawnPosEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_get_player_spawn_pos_event_data_class(), 0, 0, data);

	emit_ruby_event("get_player_spawn_pos", rdata);
}

void AllowPlayer::process( bz_EventData *eventData )
{
	bz_AllowPlayerEventData *data = (bz_AllowPlayerEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_allow_player_event_data_class(), 0, 0, data);
	
	emit_ruby_event("allow_player", rdata);
}

void Tick::process( bz_EventData *eventData )
{
	bz_TickEventData *data = (bz_TickEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_tick_event_data_class(), 0, 0, data);

	emit_ruby_event("tick", rdata);
}

void GenerateWorld::process( bz_EventData *eventData )
{
	bz_GenerateWorldEventData *data = (bz_GenerateWorldEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_generate_world_event_data_class(), 0, 0, data);
	
	emit_ruby_event("generate_world", rdata);
}

void GetPlayerInfo::process( bz_EventData *eventData )
{
	bz_GetPlayerInfoEventData *data = (bz_GetPlayerInfoEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_get_player_info_event_data_class(), 0, 0, data);
	
	emit_ruby_event("get_player_info", rdata);
}

void GetAutoTeam::process( bz_EventData *eventData )
{
	bz_GetAutoTeamEventData *data = (bz_GetAutoTeamEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_get_auto_team_event_data_class(), 0, 0, data);
	
	emit_ruby_event("get_auto_team", rdata);
}

void AllowSpawnData::process( bz_EventData *eventData )
{
	bz_AllowSpawnData *data = (bz_AllowSpawnData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_allow_spawn_data_class(), 0, 0, data);
	
	emit_ruby_event("allow_spawn_data", rdata);
}

void ListServerUpdateEvent::process( bz_EventData *eventData )
{
	bz_ListServerUpdateEvent *data = (bz_ListServerUpdateEvent *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_list_server_update_event_class(), 0, 0, data);
	
	emit_ruby_event("list_server_update", rdata);
}

void Ban::process( bz_EventData *eventData )
{
	bz_BanEventData *data = (bz_BanEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_ban_event_data_class(), 0, 0, data);
	
	emit_ruby_event("ban", rdata);
}

void HostBan::process( bz_EventData *eventData )
{
	bz_HostBanEventData *data = (bz_HostBanEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_host_ban_event_data_class(), 0, 0, data);
	
	emit_ruby_event("host_ban", rdata);
}

void Kick::process( bz_EventData *eventData )
{
	bz_KickEventData *data = (bz_KickEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_kick_event_data_class(), 0, 0, data);
	
	emit_ruby_event("kick", rdata);
}

void Kill::process( bz_EventData *eventData )
{
	bz_KillEventData *data = (bz_KillEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_kill_event_data_class(), 0, 0, data);
	
	emit_ruby_event("kill", rdata);
}

void PlayerPaused::process( bz_EventData *eventData )
{
	bz_PlayerPausedEventData *data = (bz_PlayerPausedEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_player_paused_event_data_class(), 0, 0, data);
	
	emit_ruby_event("player_pause", rdata);
}

void MessageFiltered::process( bz_EventData *eventData )
{
	bz_MessageFilteredEventData *data = (bz_MessageFilteredEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_message_filtered_event_data_class(), 0, 0, data);

	//emit_ruby_event("message_filtered", rdata);
}

void GameStartEnd::process( bz_EventData *eventData )
{
	bz_GameStartEndEventData *data = (bz_GameStartEndEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_game_start_end_event_data_class(), 0, 0, data);

	if ( eventData->eventType ==  bz_eGameStartEvent)
		emit_ruby_event("game_start", rdata);

	if ( eventData->eventType == bz_eGameEndEvent)
		emit_ruby_event("game_end", rdata);
	
}

void SlashCommand::process( bz_EventData *eventData )
{
	bz_SlashCommandEventData *data = (bz_SlashCommandEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_slash_command_event_data_class(), 0, 0, data);
	
	emit_ruby_event("slash_command", rdata);
}

void PlayerAuth::process( bz_EventData *eventData )
{
	bz_PlayerAuthEventData *data = (bz_PlayerAuthEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_player_auth_event_data_class(), 0, 0, data);

	//emit_ruby_event("player_auth", rdata);
}

void ServerMsg::process( bz_EventData *eventData )
{
	bz_ServerMsgEventData *data = (bz_ServerMsgEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_server_msg_event_data_class(), 0, 0, data);
	
	emit_ruby_event("server_msg", rdata);
}

void ShotFired::process( bz_EventData *eventData )
{
	bz_ShotFiredEventData *data = (bz_ShotFiredEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_shot_fired_event_data_class(), 0, 0, data);

	emit_ruby_event("shot_fired", rdata);
}

void PlayerUpdate::process( bz_EventData *eventData )
{
	bz_PlayerUpdateEventData *data = (bz_PlayerUpdateEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_player_update_event_data_class(), 0, 0, data);

	//emit_ruby_event("player_update", rdata);
}

void NetTransfer::process( bz_EventData *eventData )
{
	bz_NetTransferEventData *data = (bz_NetTransferEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_net_transfer_event_data_class(), 0, 0, data);

	//emit_ruby_event("net_transfer", rdata);
}

void Loging::process( bz_EventData *eventData )
{
	bz_LogingEventData *data = (bz_LogingEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_loging_event_data_class(), 0, 0, data);
}

void ShotEnded::process( bz_EventData *eventData )
{
	bz_ShotEndedEventData *data = (bz_ShotEndedEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_shot_ended_event_data_class(), 0, 0, data);
	
	emit_ruby_event("shot_ended", rdata);
}

void FlagTransferred::process( bz_EventData *eventData )
{
	bz_FlagTransferredEventData *data = (bz_FlagTransferredEventData *) eventData;

	//VALUE rdata = Data_Wrap_Struct(c_flag_transferred_event_data_class(), 0, 0, data);

	//emit_ruby_event("flag_transferred", rdata);
}

void FlagGrabbed::process( bz_EventData *eventData )
{
	bz_FlagGrabbedEventData *data = (bz_FlagGrabbedEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_flag_grabbed_event_data_class(), 0, 0, data);

	emit_ruby_event("flag_grabbed", rdata);
}

void FlagDropped::process( bz_EventData *eventData )
{
	bz_FlagDroppedEventData *data = (bz_FlagDroppedEventData *) eventData;

	VALUE rdata = Data_Wrap_Struct(c_flag_dropped_event_data_class(), 0, 0, data);

	emit_ruby_event("flag_dropped", rdata);
}
